package com.twu.biblioteca.librarycollection;

import java.util.*;

/**
 * Created with IntelliJ IDEA.
 * User: Maximilian
 * Date: 3/10/13
 * Time: 9:07 AM
 * To change this template use File | Settings | File Templates.
 */
public class BookCollection {
    Set<String> books = new HashSet<String>();

    public void addBook(String book)
    {
        books.add(book);
    }

    public List<String> getBooks()
    {
        List <String> sortedBooks = new ArrayList<String>();
        sortedBooks.addAll(books);

        Collections.sort(sortedBooks);

        return sortedBooks;
    }

    public boolean isBookAvailable(String book)
    {
        return books.contains(book);
    }

}
